
/**
 * feedback vuex
 */
import posts from '@/plugins/request'
const state = {
  feedbackList: {
    rows: [],
    total: 0
  }
}
// getters
const getters = {
  getFeedbackList: state => state.feedbackList,
}
// actions
const actions = {
  async postFeedback({ commit }, data) {
    let res = await posts.postFeedback(data)
    return res
  },
  async fetchFeedbackList({commit}, params) {
    let data = await posts.getFeedbackList(params)
    commit('changeFeedbackList', data)
  }
}
// mutations
const mutations = {
  changeFeedbackList(state, data) {
    state.feedbackList = data
  }
}
export default {
  state,
  getters,
  actions,
  mutations
}
